package com.scf.fruit.business.hospital.web;

import com.scf.fruit.business.hospital.bo.HospitalBo;
import com.scf.fruit.business.hospital.po.request.HospitalReq;
import com.scf.fruit.util.DataTablesRes;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * @author : 孙超飞
 * @title :
 * @description :
 * @date : 2018-04-20 17:53
 */
@RestController
@RequestMapping(value = "/hospital",produces = "application/json")
public class HospitalController {
    @Resource
    private HospitalBo hospitalBo;

    @RequestMapping(value = "/queryList",method = RequestMethod.POST)
    public DataTablesRes queryList(@RequestBody HospitalReq req){
        return hospitalBo.queryList(req);
    }

    @RequestMapping(value = "/update",method = RequestMethod.POST)
    public boolean update(@RequestBody HospitalReq req){
        return hospitalBo.update(req);
    }


    @RequestMapping(value = "/insert",method = RequestMethod.POST)
    public boolean insert(@RequestBody HospitalReq req){
        return hospitalBo.insert(req);
    }


    @RequestMapping(value = "/export",method = RequestMethod.POST)
    public void export(HttpServletResponse res){
        hospitalBo.exportOrder(res);
    }

}
